import 'package:bazi/model/DaYunModel.dart';
import 'package:bazi/model/LiuNianModel.dart';
import 'package:bazi/model/jieqi_model.dart';
import 'package:bazi/model/paipan_model.dart';
import 'package:bazi/model/sizhu_model.dart';

class PaipanUtil{
  static  PaipanUtil _util = PaipanUtil();
  static PaipanUtil instance(){
    return _util;
  }
  var zhis = [ '子','丑','寅', '卯', '辰', '巳', '午','未', '申', '酉', '戌', '亥', ];
  var gans = ['癸', '甲', '乙', '丙', '丁', '戊', '己', '庚', '辛', '壬',];
  ///时辰
  var items= ["子时 00:00-00:59","丑时 01:00-02:59","寅时 03:00-04:59",
    "卯时 05:00-06:59","辰时 07:00-08:59","巳时 09:00-10:59",
    "午时 11:00-12:59","未时 13:00-14:59","申时 15:00-16:59",
    "酉时 17:00-18:59","戌时 19:00-20:59","亥时 21:00-22:59",
    "子时 23:00-23:59"];
  ///十神
  var shishen = {
    '甲':{'甲':'比肩','乙':'劫财','丙':'食神','丁':'伤官','戊':'偏财','己':'正财','庚':'七杀','辛':'正官','壬':'偏印','癸':'正印'},
    '乙':{'甲':'劫财','乙':'比肩','丙':'伤官','丁':'食神','戊':'正财','己':'偏财','庚':'正官','辛':'七杀','壬':'正印','癸':'偏印'},
    '丙':{'甲':'偏印','乙':'正印','丙':'比肩','丁':'劫财','戊':'食神','己':'伤官','庚':'偏财','辛':'正财','壬':'七杀','癸':'正官'},
    '丁':{'甲':'正印','乙':'偏印','丙':'劫财','丁':'比肩','戊':'伤官','己':'食神','庚':'正财','辛':'偏财','壬':'正官','癸':'七杀'},
    '戊':{'甲':'七杀','乙':'正官','丙':'偏印','丁':'正印','戊':'比肩','己':'劫财','庚':'食神','辛':'伤官','壬':'偏财','癸':'正财'},
    '己':{'甲':'正官','乙':'七杀','丙':'正印','丁':'偏印','戊':'劫财','己':'比肩','庚':'伤官','辛':'食神','壬':'正财','癸':'偏财'},
    '庚':{'甲':'偏财','乙':'正财','丙':'七杀','丁':'正官','戊':'偏印','己':'正印','庚':'比肩','辛':'劫财','壬':'食神','癸':'伤官'},
    '辛':{'甲':'正财','乙':'偏财','丙':'正官','丁':'七杀','戊':'正印','己':'偏印','庚':'劫财','辛':'比肩','壬':'伤官','癸':'食神'},
    '壬':{'甲':'食神','乙':'伤官','丙':'偏财','丁':'正财','戊':'七杀','己':'正官','庚':'偏印','辛':'正印','壬':'比肩','癸':'劫财'},
    '癸':{'甲':'伤官','乙':'食神','丙':'正财','丁':'偏财','戊':'正官','己':'七杀','庚':'正印','辛':'偏印','壬':'劫财','癸':'比肩'},
  };
  ///地支藏干
  var hiddenGan = {
    '寅':['甲','丙','戊'],
    '卯':['乙'],
    '辰':['戊','乙','壬'],
    '巳':['丙','戊','庚'],
    '午':['丁','己'],
    '未':['己','丁','乙'],
    '申':['庚','壬','戊'],
    '酉':['辛'],
    '戌':['戊','辛','丁'],
    '亥':['壬','甲'],
    '子':['癸'],
    '丑':['己','癸','辛']
  };
  ///十天干旺衰
  var riseDecline = {
    '甲':{'亥':'长生','子':'沐浴','丑':'冠带','寅':'临官','卯':'帝旺','辰':'衰','巳':'病','午':'死','未':'墓','申':'绝','酉':'胎','戌':'养'},
    '乙':{'亥':'死','子':'病','丑':'衰','寅':'帝王','卯':'临官','辰':'冠带','巳':'沐浴','午':'长生','未':'养','申':'胎','酉':'绝','戌':'墓'},
    '丙':{'亥':'绝','子':'胎','丑':'养','寅':'长生','卯':'沐浴','辰':'冠带','巳':'临官','午':'帝旺','未':'衰','申':'病','酉':'死','戌':'墓'},
    '戊':{'亥':'绝','子':'胎','丑':'养','寅':'长生','卯':'沐浴','辰':'冠带','巳':'临官','午':'帝旺','未':'衰','申':'病','酉':'死','戌':'墓'},
    '丁':{'亥':'胎','子':'绝','丑':'墓','寅':'死','卯':'病','辰':'衰','巳':'帝旺','午':'临官','未':'冠带','申':'沐浴','酉':'长生','戌':'养'},
    '己':{'亥':'胎','子':'绝','丑':'墓','寅':'死','卯':'病','辰':'衰','巳':'帝旺','午':'临官','未':'冠带','申':'沐浴','酉':'长生','戌':'养'},
    '庚':{'亥':'病','子':'死','丑':'墓','寅':'绝','卯':'胎','辰':'养','巳':'长生','午':'沐浴','未':'冠带','申':'临官','酉':'帝旺','戌':'衰'},
    '辛':{'亥':'沐浴','子':'长生','丑':'养','寅':'胎','卯':'绝','辰':'墓','巳':'死','午':'病','未':'衰','申':'帝旺','酉':'临官','戌':'冠带'},
    '壬':{'亥':'临官','子':'帝旺','丑':'衰','寅':'病','卯':'死','辰':'墓','巳':'绝','午':'胎','未':'养','申':'长生','酉':'沐浴','戌':'冠带'},
    '癸':{'亥':'帝旺','子':'临官','丑':'冠带','寅':'沐浴','卯':'长生','辰':'养','巳':'胎','午':'绝','未':'墓','申':'死','酉':'病','戌':'衰'},
  };

  ///六十甲子纳音
  var nayin = {
    '甲子':'海中金','乙丑':'海中金','丙寅':'炉中火','丁卯':'炉中火','戊辰':'大林木','己巳':'大林木','庚午':'路旁土','辛未':'路旁土','壬申':'剑锋金',
    '癸酉':'剑锋金','甲戌':'山头火','乙亥':'山头火','丙子':'涧下水','丁丑':'涧下水','戊寅':'城头土','己卯':'城头土','庚辰':'白腊金','辛巳':'白腊金',
    '壬午':'杨柳木','癸未':'杨柳木','甲申':'井泉水','乙酉':'井泉水','丙戌':'屋上土','丁亥':'屋上土','戊子':'霹雳火','己丑':'霹雳火','庚寅':'松柏木',
    '辛卯':'松柏木','壬辰':'长流水','癸巳':'长流水','甲午':'沙中金','乙未':'沙中金','丙申':'山下火','丁酉':'山下火','戊戌':'平地木','己亥':'平地木',
    '庚子':'壁上土','辛丑':'壁上土','壬寅':'金箔金','癸卯':'金箔金','甲辰':'覆灯火','乙巳':'覆灯火','丙午':'天河水','丁未':'天河水','戊申':'大驿土',
    '己酉':'大驿土','庚戌':'钗钏金','辛亥':'钗钏金','壬子':'桑柘木','癸丑':'桑柘木','甲寅':'大溪水','乙卯':'大溪水','丙辰':'沙中土','丁巳':'沙中土',
    '戊午':'天上火','己未':'天上火','庚申':'石榴木','辛酉':'石榴木','壬戌':'大海水','癸亥':'大海水'
  };
  ///地支六合
  List<String> liuHe = ["辰酉","子丑","巳申","寅亥","卯戌","午未"];
  ///地支六害
  List<String> liuHai = ["子未","丑午","寅巳","卯辰","酉戌","申亥"];
  ///地支六冲
  List<String> liuChong = ["子午","丑未","寅申","巳亥","卯酉","辰戌"];
  ///天干五合
  List<String> wuHe = ["戊癸","乙庚","丙辛","甲己","丁壬"];

  ///排四柱
  SizhuModel getSizhu(int century,int year,int month,int day,int hour,JieqiModel jieqiModel){
    SizhuModel sizhuModel = SizhuModel();

    //判断是几月
    int yue = 0;
    if(jieqiModel.range[0].contains("$month月$day")){
      yue = 0;
    }
    if(jieqiModel.range[1].contains("$month月$day")){
      yue= 1;
    }
    if(jieqiModel.range[2].contains("$month月$day")){
      yue= 2;
    }
    if(jieqiModel.range[3].contains("$month月$day")){
      yue= 3;
    }
    if(jieqiModel.range[4].contains("$month月$day")){

      yue= 4;
    }
    if(jieqiModel.range[5].contains("$month月$day")){
      yue= 5;
    }
    if(jieqiModel.range[6].contains("$month月$day")){
      yue= 6;
    }
    if(jieqiModel.range[7].contains("$month月$day")){
      yue= 7;
    }
    if(jieqiModel.range[8].contains("$month月$day")){
      yue= 8;
    }
    if(jieqiModel.range[9].contains("$month月$day")){
      yue= 9;
    }
    if(jieqiModel.range[10].contains("$month月$day")){
      yue= 10;
    }
    if(jieqiModel.range[11].contains("$month月$day")){
      yue= 11;
    }
    if(month==1){
      year--;
      month = 13;
    }
    if(month==2){
      year--;
      month=14;

    }
    var centuryYear = int.parse(century.toString()+year.toString());
    int index = (centuryYear - 1803) % 60;


    //年柱
    sizhuModel.yearG = gans[index % 10];
    if(index % 12 == 0){
      sizhuModel.yearZ = zhis[11];
    }else{
      sizhuModel.yearZ = zhis[index % 12-1];
    }

    //月柱

    sizhuModel.monthZ = zhis[(yue+2)%12];
    print("月支：${sizhuModel.monthZ}");
    switch (sizhuModel.yearG) {
      case '甲':
      case '己':
        int i = gans.indexOf('丙') + yue;
        sizhuModel.monthG = gans[i % 10];
        break;
      case '乙' :
      case '庚':
        int i = gans.indexOf('戊') + yue;
        sizhuModel.monthG = gans[i % 10];
        break;
      case '丙' :
      case '辛':
        int i = gans.indexOf('庚') + yue;
        sizhuModel.monthG = gans[i % 10];
        print(sizhuModel.monthG);
        break;
      case '丁' :
      case '壬':
        int i = gans.indexOf('壬') + yue;
        sizhuModel.monthG = gans[i % 10];
        break;
      case '戊':
      case '癸':
        int i = gans.indexOf('甲') + yue;
        sizhuModel.monthG = gans[i % 10];
        break;
    }
    if(month==1){
      year--;
      month = 13;
    }
    if(month==2){
      year--;
      month=14;

    }
    //日柱
    index = 4*century+century~/4+5*year+year~/4+(3*(month+1)/5)~/1+day-3;
    sizhuModel.dayG = gans[index%10];
    int i ;
    if(month%2==0){
      i = 6;
    }else{
      i = 0;
    }
    index = 8*century+century~/4+5*year+year~/4+3*(month+1)~/5+day+7+i;
    sizhuModel.dayZ = zhis[(index-1) % 12];

    //时柱
    sizhuModel.hourZ = zhis[hour];
    switch (sizhuModel.dayG) {
      case '甲':
      case '己':
        int i = gans.indexOf('甲') + hour;
        sizhuModel.hourG = gans[i % 10];
        break;
      case '乙' :
      case '庚':
        int i = gans.indexOf('丙') + hour;
        sizhuModel.hourG = gans[i % 10];
        break;
      case '丙' :
      case '辛':
        int i = gans.indexOf('戊') + hour;
        sizhuModel.hourG = gans[i % 10];
        break;
      case '丁' :
      case '壬':
        int i = gans.indexOf('庚') + hour;
        sizhuModel.hourG = gans[i % 10];
        break;
      case '戊':
      case '癸':
        int i = gans.indexOf('壬') + hour;
        sizhuModel.hourG = gans[i % 10];
        break;
    }
    return sizhuModel;
  }
  ///排盘
  PaipanModel getPaipan(int century,int year,int month,int day,int hour,JieqiModel jieqiModel,int sex) {
    PaipanModel paipanModel = PaipanModel();
    SizhuModel sizhuModel = getSizhu(century, year, month, day, hour, jieqiModel);
    var yearStr ;
    if(year<10){
      yearStr= "0"+year.toString();
    }else{
      yearStr= year.toString();
    }


    //判断是几月
    if(jieqiModel.range[0].contains("$month月$day")){
      paipanModel.yue = 0;
      paipanModel.qianJie = '立春 $century$yearStr年2月${jieqiModel.limit[0]}';
      paipanModel.houJie = '惊蛰 $century$yearStr年3月${jieqiModel.limit[2]}';

    }
    if(jieqiModel.range[1].contains("$month月$day")){
      paipanModel.yue = 1;
      paipanModel.qianJie = '惊蛰 $century$yearStr年3月${jieqiModel.limit[2]}';
      paipanModel.houJie = '清明 $century$yearStr年4月${jieqiModel.limit[4]}';


    }
    if(jieqiModel.range[2].contains("$month月$day")){
      paipanModel.yue = 2;
      paipanModel.qianJie = '清明 $century$yearStr年4月${jieqiModel.limit[4]}';
      paipanModel.houJie = '立夏 $century$yearStr年5月${jieqiModel.limit[6]}';


    }
    if(jieqiModel.range[3].contains("$month月$day")){
      paipanModel.yue = 3;
      paipanModel.qianJie = '立夏 $century$yearStr年5月${jieqiModel.limit[6]}';
      paipanModel.houJie = '芒种 $century$yearStr年6月${jieqiModel.limit[8]}';


    }
    if(jieqiModel.range[4].contains("$month月$day")){
      paipanModel.yue = 4;
      paipanModel.qianJie = '芒种 $century$yearStr年6月${jieqiModel.limit[8]}';
      paipanModel.houJie = '小暑 $century$yearStr年7月${jieqiModel.limit[10]}';


    }
    if(jieqiModel.range[5].contains("$month月$day")){
      paipanModel.yue = 5;
      paipanModel.qianJie = '小暑 $century$yearStr年7月${jieqiModel.limit[10]}';
      paipanModel.houJie = '立秋 $century$yearStr年8月${jieqiModel.limit[12]}';


    }
    if(jieqiModel.range[6].contains("$month月$day")){
      paipanModel.yue = 6;
      paipanModel.qianJie = '立秋 $century$yearStr年8月${jieqiModel.limit[12]}';
      paipanModel.houJie = '白露 $century$yearStr年9月${jieqiModel.limit[14]}';


    }
    if(jieqiModel.range[7].contains("$month月$day")){
      paipanModel.yue = 7;
      paipanModel.qianJie = '白露 $century$yearStr年9月${jieqiModel.limit[14]}';
      paipanModel.houJie = '寒露 $century$yearStr年10月${jieqiModel.limit[16]}';

    }
    if(jieqiModel.range[8].contains("$month月$day")){
      paipanModel.yue = 8;
      paipanModel.qianJie = '寒露 $century$yearStr年10月${jieqiModel.limit[16]}';
      paipanModel.houJie = '立冬 $century$yearStr年11月${jieqiModel.limit[18]}';
    }
    if(jieqiModel.range[9].contains("$month月$day")){
      paipanModel.yue = 9;
      paipanModel.qianJie = '立冬 $century$yearStr年11月${jieqiModel.limit[18]}';
      paipanModel.houJie = '大雪 $century$yearStr年12月${jieqiModel.limit[20]}';
    }
    if(jieqiModel.range[10].contains("$month月$day")){
      paipanModel.yue = 10;
      paipanModel.qianJie = '大雪 $century$yearStr年12月${jieqiModel.limit[20]}';
      paipanModel.houJie = '小寒 $century$yearStr年1月${jieqiModel.limit[22]}';
    }
    if(jieqiModel.range[11].contains("$month月$day")){
      paipanModel.yue = 11;
      paipanModel.qianJie = '小寒 $century$yearStr年1月${jieqiModel.limit[22]}';
      paipanModel.houJie = '立春 $century$yearStr年2月${jieqiModel.limit[0]}';
    }


    //大运
    var gan = sizhuModel.monthG;
    var zhi = sizhuModel.monthZ;
    if(sex==0){
      //乾造
      switch(sizhuModel.yearG){
      //阳年
        case '甲':
        case '丙':
        case '戊':
        case '庚':
        case '壬':
          for(int i =1;i<9;i++){
            var daYunModel = DaYunModel();
            gan = gans[(gans.indexOf(gan)+1)%10];
            zhi = zhis[(zhis.indexOf(zhi)+1)%12];
            daYunModel.ganzhi = gan+zhi;
            paipanModel.daYun.add(daYunModel);
          }
          break;
      //阴年
        case '乙':
        case '丁':
        case '己':
        case '辛':
        case '癸':
          for(int i =1;i<9;i++){
            var daYunModel = DaYunModel();
            gan = gans[(gans.indexOf(gan)-1)%10];
            zhi = zhis[(zhis.indexOf(zhi)-1)%12];
            daYunModel.ganzhi = gan+zhi;
            paipanModel.daYun.add(daYunModel);
          }

      }
    }else{
      //坤造
      switch(sizhuModel.yearG){
      //阳年
        case '甲':
        case '丙':
        case '戊':
        case '庚':
        case '壬':
          for(int i =1;i<9;i++){
            var daYunModel = DaYunModel();
            gan = gans[(gans.indexOf(gan)-1)%10];
            zhi = zhis[(zhis.indexOf(zhi)-1)%12];
            daYunModel.ganzhi = gan+zhi;
            paipanModel.daYun.add(daYunModel);
          }
          break;
      //阴年
        case '乙':
        case '丁':
        case '己':
        case '辛':
        case '癸':
          for(int i =1;i<9;i++){
            var daYunModel = DaYunModel();
            gan = gans[(gans.indexOf(gan)+1)%10];
            zhi = zhis[(zhis.indexOf(zhi)+1)%12];
            daYunModel.ganzhi = gan+zhi;

            paipanModel.daYun.add(daYunModel);
          }


      }
    }

    //大运天干十神,地支旺衰
    paipanModel.daYun.forEach((e) {
      e.ganSS = shishen[sizhuModel.dayG]![e.ganzhi.substring(0,1)]!;
      e.zhiWS = riseDecline[sizhuModel.dayG]![e.ganzhi.substring(1,2)]!;
    });

    //起运时间
    int qiYear = 0;
    int qiMonth = 0;
    int index = jieqiModel.range[paipanModel.yue].indexOf("$month月$day");
    int firstD = jieqiModel.limit[paipanModel.yue*2];
    int secondD = jieqiModel.limit[paipanModel.yue*2+1];
    if(day > firstD && day <secondD){
      qiYear = (secondD-day)~/3;
      qiMonth = (secondD-day)%3*4;
    }
    if(day> secondD){
      qiYear = (jieqiModel.range[paipanModel.yue].length- index)~/3;
      qiMonth = (jieqiModel.range[paipanModel.yue].length- index)%3*4;
    }


    //起运周岁
    if(qiMonth==0){
      paipanModel.qiYunAge = '$qiYear岁';
    }else{
      paipanModel.qiYunAge = '$qiYear岁$qiMonth个月';
    }

    //起运虚岁
    for(int i =0;i<8;i++){
      paipanModel.daYun[i].xuSui=(1+i*10+qiYear).toString();
    }

    //起运时间
    if(month+qiMonth>12){
      qiYear++;
      qiMonth = (month+qiMonth)%12;
    }else{
      qiMonth = month+qiMonth;
    }
    //交运时间
    var firstYear = int.parse(century.toString()+yearStr)+qiYear;
    for(int i =0;i<8;i++){
      paipanModel.daYun[i].crossYear=(i*10+firstYear).toString();
    }

    gan = gans[(gans.indexOf(sizhuModel.yearG)+qiYear-1)%10];
    zhi = zhis[(zhis.indexOf(sizhuModel.yearZ)+qiYear-1)%12];
    for(int i = 0;i<80;i++){
      LiuNianModel liuNianModel = new LiuNianModel();
      gan = gans[(gans.indexOf(gan)+1)%10];
      zhi = zhis[(zhis.indexOf(zhi)+1)%12];
      liuNianModel.year = (firstYear+i).toString();
      liuNianModel.ganZ = gan+zhi;
      paipanModel.liuNian.add(liuNianModel);
    }
    paipanModel.qiYunDate = '$firstYear年$qiMonth月';
    paipanModel.sizhuModel = sizhuModel;


    paipanModel.kongwang = getKongwang(sizhuModel.dayG, sizhuModel.dayZ);
    return paipanModel;

  }

  ///空亡计算
  String getKongwang(String dayG,String dayZ){
    String kongW = '';
    var gan = dayG;
    var zhi = dayZ;
    for(int i = 0;i<9;i++){
      gan = gans[(gans.indexOf(gan)+1)%10];
      zhi = zhis[(zhis.indexOf(zhi)+1)%12];
      if(gan == '癸'){
        break;
      }
    }
    kongW = "${zhis[(zhis.indexOf(zhi)+1)%12]},${zhis[(zhis.indexOf(zhi)+2)%12]}";
    return kongW;
  }
  ///四柱神煞
  List<List<String>> getShensha(SizhuModel sizhuModel){
    var list = <List<String>>[];
    var yearList = <String>[];
    var monthList = <String>[];
    var dayList = <String>[];
    var hourList = <String>[];
    //天乙贵人
    switch(sizhuModel.dayG){
      case '甲':
      case '戊':
        if(sizhuModel.yearZ == '丑'|| sizhuModel.yearZ == '未'){
          yearList.add('天乙贵人');
        }
        if(sizhuModel.monthZ == '丑'|| sizhuModel.monthZ == '未'){
          monthList.add('天乙贵人');
        }
        if(sizhuModel.dayZ == '丑'|| sizhuModel.dayZ == '未'){
          dayList.add('天乙贵人');
        }
        if(sizhuModel.hourZ == '丑'|| sizhuModel.hourZ == '未'){
          hourList.add('天乙贵人');
        }
        break;
      case '乙':
      case '己':
        if(sizhuModel.yearZ == '子'|| sizhuModel.yearZ == '申'){
          yearList.add('天乙贵人');
        }
        if(sizhuModel.monthZ == '子'|| sizhuModel.monthZ == '申'){
          monthList.add('天乙贵人');
        }
        if(sizhuModel.dayZ == '子'|| sizhuModel.dayZ == '申'){
          dayList.add('天乙贵人');
        }
        if(sizhuModel.hourZ == '子'|| sizhuModel.hourZ == '申'){
          hourList.add('天乙贵人');
        }
        break;
      case '丙':
      case '丁':
        if(sizhuModel.yearZ == '亥'|| sizhuModel.yearZ == '酉'){
          yearList.add('天乙贵人');
        }
        if(sizhuModel.monthZ == '亥'|| sizhuModel.monthZ == '酉'){
          monthList.add('天乙贵人');
        }
        if(sizhuModel.dayZ == '亥'|| sizhuModel.dayZ == '酉'){
          dayList.add('天乙贵人');
        }
        if(sizhuModel.hourZ == '亥'|| sizhuModel.hourZ == '酉'){
          hourList.add('天乙贵人');
        }
        break;
      case '壬':
      case '癸':
        if(sizhuModel.yearZ == '巳'|| sizhuModel.yearZ == '卯'){
          yearList.add('天乙贵人');
        }
        if(sizhuModel.monthZ == '巳'|| sizhuModel.monthZ == '卯'){
          monthList.add('天乙贵人');
        }
        if(sizhuModel.dayZ == '巳'|| sizhuModel.dayZ == '卯'){
          dayList.add('天乙贵人');
        }
        if(sizhuModel.hourZ == '巳'|| sizhuModel.hourZ == '卯'){
          hourList.add('天乙贵人');
        }
        break;
      case '庚':
      case '辛':
        if(sizhuModel.yearZ == '寅'|| sizhuModel.yearZ == '午'){
          yearList.add('天乙贵人');
        }
        if(sizhuModel.monthZ == '寅'|| sizhuModel.monthZ == '午'){
          monthList.add('天乙贵人');
        }
        if(sizhuModel.dayZ == '寅'|| sizhuModel.dayZ == '午'){
          dayList.add('天乙贵人');
        }
        if(sizhuModel.hourZ == '寅'|| sizhuModel.hourZ == '午'){
          hourList.add('天乙贵人');
        }
        break;
    }

    //太极贵人
    switch(sizhuModel.dayG){
      case '甲':
      case '乙':
      if(sizhuModel.yearZ == '子'|| sizhuModel.yearZ == '午'){
        yearList.add('太极贵人');
      }
      if(sizhuModel.monthZ == '子'|| sizhuModel.monthZ == '午'){
        monthList.add('太极贵人');
      }
      if(sizhuModel.dayZ == '子'|| sizhuModel.dayZ == '午'){
        dayList.add('太极贵人');
      }
      if(sizhuModel.hourZ == '子'|| sizhuModel.hourZ == '午'){
        hourList.add('太极贵人');
      }
        break;
      case '丙':
      case '丁':
      if(sizhuModel.yearZ == '酉'|| sizhuModel.yearZ == '卯'){
        yearList.add('太极贵人');
      }
      if(sizhuModel.monthZ == '酉'|| sizhuModel.monthZ == '卯'){
        monthList.add('太极贵人');
      }
      if(sizhuModel.dayZ == '酉'|| sizhuModel.dayZ == '卯'){
        dayList.add('太极贵人');
      }
      if(sizhuModel.hourZ == '酉'|| sizhuModel.hourZ == '卯'){
        hourList.add('太极贵人');
      }
        break;
      case '戊':
      case '己':
      if(sizhuModel.yearZ == '辰'|| sizhuModel.yearZ == '未'||sizhuModel.yearZ == '戌'|| sizhuModel.yearZ == '丑'){
        yearList.add('太极贵人');
      }
      if(sizhuModel.monthZ == '辰'|| sizhuModel.monthZ == '未'||sizhuModel.monthZ == '戌'|| sizhuModel.monthZ == '丑'){
        monthList.add('太极贵人');
      }
      if(sizhuModel.dayZ == '辰'|| sizhuModel.dayZ == '未'||sizhuModel.dayZ == '戌'|| sizhuModel.dayZ == '丑'){
        dayList.add('太极贵人');
      }
      if(sizhuModel.hourZ == '辰'|| sizhuModel.hourZ == '未'||sizhuModel.hourZ == '戌'|| sizhuModel.hourZ == '丑'){
        hourList.add('太极贵人');
      }
        break;
      case '庚':
      case '辛':
      if(sizhuModel.yearZ == '寅'|| sizhuModel.yearZ == '亥'){
        yearList.add('太极贵人');
      }
      if(sizhuModel.monthZ == '寅'|| sizhuModel.monthZ == '亥'){
        monthList.add('太极贵人');
      }
      if(sizhuModel.dayZ == '寅'|| sizhuModel.dayZ == '亥'){
        dayList.add('太极贵人');
      }
      if(sizhuModel.hourZ == '寅'|| sizhuModel.hourZ == '亥'){
        hourList.add('太极贵人');
      }
        break;
      case '壬':
      case '癸':
      if(sizhuModel.yearZ == '巳'|| sizhuModel.yearZ == '申'){
        yearList.add('太极贵人');
      }
      if(sizhuModel.monthZ == '巳'|| sizhuModel.monthZ == '申'){
        monthList.add('太极贵人');
      }
      if(sizhuModel.dayZ == '巳'|| sizhuModel.dayZ == '申'){
        dayList.add('太极贵人');
      }
      if(sizhuModel.hourZ == '巳'|| sizhuModel.hourZ == '申'){
        hourList.add('太极贵人');
      }
        break;
    }
    //天德贵人
    switch(sizhuModel.monthZ){
      case '寅':
        if(sizhuModel.yearG == '丁'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '丁'){
          monthList.add('天德贵人');
        }
        if(sizhuModel.hourG == '丁'){
          hourList.add('天德贵人');
        }
        break;
      case '卯':
        if(sizhuModel.yearZ == '申'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('天德贵人');
        }

        if(sizhuModel.hourZ == '申'){
          hourList.add('天德贵人');
        }
        break;
      case '辰':
        if(sizhuModel.yearG == '壬'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '壬'){
          monthList.add('天德贵人');
        }
        if(sizhuModel.hourG == '壬'){
          hourList.add('天德贵人');
        }
        break;
      case '巳':
        if(sizhuModel.yearG == '辛'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '辛'){
          monthList.add('天德贵人');
        }
        if(sizhuModel.hourG == '辛'){
          hourList.add('天德贵人');
        }
        break;
      case '午':
        if(sizhuModel.yearZ == '亥'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthZ == '亥'){
          monthList.add('天德贵人');
        }
        if(sizhuModel.dayZ == '亥'){
          dayList.add('天德贵人');
        }
        if(sizhuModel.hourZ == '亥'){
          hourList.add('天德贵人');
        }
        break;
      case '未':
        if(sizhuModel.yearG == '甲'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '甲'){
          monthList.add('天德贵人');
        }

        if(sizhuModel.hourG == '甲'){
          hourList.add('天德贵人');
        }
        break;
      case '申':
        if(sizhuModel.yearG == '癸'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '癸'){
          monthList.add('天德贵人');
        }

        if(sizhuModel.hourG == '癸'){
          hourList.add('天德贵人');
        }
        break;
      case '酉':
        if(sizhuModel.yearZ == '寅'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add('天德贵人');
        }
        if(sizhuModel.dayZ == '寅'){
          dayList.add('天德贵人');
        }
        if(sizhuModel.hourZ == '寅'){
          hourList.add('天德贵人');
        }
        break;
      case '戌':
        if(sizhuModel.yearG == '丙'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '丙'){
          monthList.add('天德贵人');
        }

        if(sizhuModel.hourG == '丙'){
          hourList.add('天德贵人');
        }
        break;
      case '亥':
        if(sizhuModel.yearG == '乙'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '乙'){
          monthList.add('天德贵人');
        }

        if(sizhuModel.hourG == '乙'){
          hourList.add('天德贵人');
        }
        break;
      case '子':
        if(sizhuModel.yearZ == '巳'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add('天德贵人');
        }
        if(sizhuModel.dayZ == '巳'){
          dayList.add('天德贵人');
        }
        if(sizhuModel.hourZ == '巳'){
          hourList.add('天德贵人');
        }
        break;
      case '丑':
        if(sizhuModel.yearG == '庚'){
          yearList.add('天德贵人');
        }
        if(sizhuModel.monthG == '庚'){
          monthList.add('天德贵人');
        }

        if(sizhuModel.hourG == '庚'){
          hourList.add('天德贵人');
        }
        break;
    }
    //月德贵人
    switch(sizhuModel.monthZ){
      case '寅':
      case '午':
      case '戌':
      if(sizhuModel.yearG == '丙'){
        yearList.add('月德贵人');
      }
      if(sizhuModel.monthG == '丙'){
        monthList.add('月德贵人');
      }

      if(sizhuModel.hourG == '丙'){
        hourList.add('月德贵人');
      }
        break;
      case '申':
      case '子':
      case '辰':
        if(sizhuModel.yearG == '壬'){
          yearList.add('月德贵人');
        }
        if(sizhuModel.monthG == '壬'){
          monthList.add('月德贵人');
        }

        if(sizhuModel.hourG == '壬'){
          hourList.add('月德贵人');
        }
        break;
      case '亥':
      case '卯':
      case '未':
        if(sizhuModel.yearG == '甲'){
          yearList.add('月德贵人');
        }
        if(sizhuModel.monthG == '甲'){
          monthList.add('月德贵人');
        }

        if(sizhuModel.hourG == '甲'){
          hourList.add('月德贵人');
        }
        break;
      case '巳':
      case '酉':
      case '丑':
        if(sizhuModel.yearG == '庚'){
          yearList.add('月德贵人');
        }
        if(sizhuModel.monthG == '庚'){
          monthList.add('月德贵人');
        }

        if(sizhuModel.hourG == '庚'){
          hourList.add('月德贵人');
        }
        break;
    }

    //文昌贵人
    switch(sizhuModel.dayG){
      case '甲':
        if(sizhuModel.yearZ == '巳'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '巳'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '巳'){
          hourList.add('文昌贵人');
        }
        break;
      case '乙':
        if(sizhuModel.yearZ == '午'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '午'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '戊'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '午'){
          hourList.add('文昌贵人');
        }
        break;
      case '丙':
      case '戊':
        if(sizhuModel.yearZ == '申'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '申'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '申'){
          hourList.add('文昌贵人');
        }
        break;
      case '丁':
      case '己':
        if(sizhuModel.yearZ == '酉'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '酉'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '酉'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '酉'){
          hourList.add('文昌贵人');
        }
        break;
      case '庚':
        if(sizhuModel.yearZ == '亥'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '亥'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '亥'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '亥'){
          hourList.add('文昌贵人');
        }
        break;
      case '辛':
        if(sizhuModel.yearZ == '子'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '子'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '子'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '子'){
          hourList.add('文昌贵人');
        }
        break;
      case '壬':
        if(sizhuModel.yearZ == '寅'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '寅'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '寅'){
          hourList.add('文昌贵人');
        }
        break;
      case '癸':
        if(sizhuModel.yearZ == '卯'){
          yearList.add('文昌贵人');
        }
        if(sizhuModel.monthZ == '卯'){
          monthList.add('文昌贵人');
        }
        if(sizhuModel.dayZ == '卯'){
          monthList.add('文昌贵人');
        }

        if(sizhuModel.hourZ == '卯'){
          hourList.add('文昌贵人');
        }
        break;
    }
    //学堂
    switch(sizhuModel.dayG){
      case '甲':
      case '乙':
        if(sizhuModel.yearZ == '亥'&&sizhuModel.yearG=='己'){
          yearList.add('学堂');
        }
        if(sizhuModel.monthZ == '亥'){
          monthList.add('学堂');
        }

        if(sizhuModel.hourZ == '亥'){
          hourList.add('学堂');
        }
        break;
      case '戊':
      case '己':
        if(sizhuModel.yearZ == '申'&&sizhuModel.yearG=='戊'){
          yearList.add('学堂');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('学堂');
        }

        if(sizhuModel.hourZ == '申'){
          hourList.add('学堂');
        }
        break;
      case '丙':
      case '丁':
        if(sizhuModel.yearZ == '寅'&&sizhuModel.yearG=='丙'){
          yearList.add('学堂');
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add('学堂');
        }

        if(sizhuModel.hourZ == '寅'){
          hourList.add('学堂');
        }
        break;
      case '庚':
      case '辛':
        if(sizhuModel.yearZ == '巳'&&sizhuModel.yearG=='辛'){
          yearList.add('学堂');
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add('学堂');
        }

        if(sizhuModel.hourZ == '巳'){
          hourList.add('学堂');
        }
        break;
      case '壬':
      case '癸':
        if(sizhuModel.yearZ == '申'&&sizhuModel.yearG=='甲'){
          yearList.add('学堂');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('学堂');
        }

        if(sizhuModel.hourZ == '申'){
          hourList.add('学堂');
        }
        break;
    }

    //词馆
    switch(sizhuModel.dayG){
      case '甲':
        if(sizhuModel.yearZ == '寅'&&sizhuModel.yearG=='庚'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '寅'){
          hourList.add('词馆');
        }
        break;
      case '卯':
        if(sizhuModel.yearZ == '卯'&&sizhuModel.yearG=='辛'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '卯'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '卯'){
          hourList.add('词馆');
        }
        break;
      case '丙':
        if(sizhuModel.yearZ == '巳'&&sizhuModel.yearG=='乙'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '巳'){
          hourList.add('词馆');
        }
        break;
      case '丁':
        if(sizhuModel.yearZ == '午'&&sizhuModel.yearG=='戊'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '午'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '午'){
          hourList.add('词馆');
        }
        break;
      case '戊':
        if(sizhuModel.yearZ == '巳'&&sizhuModel.yearG=='丁'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '巳'){
          hourList.add('词馆');
        }
        break;
      case '己':
        if(sizhuModel.yearZ == '午'&&sizhuModel.yearG=='庚'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '午'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '午'){
          hourList.add('词馆');
        }
        break;
      case '庚':
        if(sizhuModel.yearZ == '申'&&sizhuModel.yearG=='壬'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '申'){
          hourList.add('词馆');
        }
        break;
      case '辛':
        if(sizhuModel.yearZ == '酉'&&sizhuModel.yearG=='癸'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '酉'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '酉'){
          hourList.add('词馆');
        }
        break;
      case '壬':
        if(sizhuModel.yearZ == '亥'&&sizhuModel.yearG=='癸'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '亥'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '亥'){
          hourList.add('词馆');
        }
        break;
      case '癸':
        if(sizhuModel.yearZ == '戌'&&sizhuModel.yearG=='壬'){
          yearList.add('词馆');
        }
        if(sizhuModel.monthZ == '戌'){
          monthList.add('词馆');
        }

        if(sizhuModel.hourZ == '戌'){
          hourList.add('词馆');
        }
        break;
    }

    //驿马
    switch(sizhuModel.dayZ){
      case '巳':
      case "酉":
      case "丑":
        if(sizhuModel.yearZ == '亥'){
          yearList.add("驿马");
        }
        if(sizhuModel.monthZ == '亥'){
          monthList.add("驿马");
        }
        if(sizhuModel.hourZ == '亥'){
          hourList.add("驿马");
        }
        break;
      case '寅':
      case "午":
      case "戌":
        if(sizhuModel.yearZ == '申'){
          yearList.add("驿马");
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add("驿马");
        }
        if(sizhuModel.hourZ == '申'){
          hourList.add("驿马");
        }
        break;
      case '亥':
      case "卯":
      case "未":
        if(sizhuModel.yearZ == '巳'){
          yearList.add("驿马");
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add("驿马");
        }
        if(sizhuModel.hourZ == '巳'){
          hourList.add("驿马");
        }
        break;
      case '申':
      case "子":
      case "辰":
        if(sizhuModel.yearZ == '寅'){
          yearList.add("驿马");
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add("驿马");
        }
        if(sizhuModel.hourZ == '寅'){
          hourList.add("驿马");
        }
        break;
    }
    //华盖
    switch(sizhuModel.dayZ){
      case '巳':
      case "酉":
      case "丑":
        if(sizhuModel.yearZ == '丑'){
          yearList.add("华盖");
        }
        if(sizhuModel.monthZ == '丑'){
          monthList.add("华盖");
        }
        if(sizhuModel.hourZ == '丑'){
          hourList.add("华盖");
        }
        break;
      case '寅':
      case "午":
      case "戌":
        if(sizhuModel.yearZ == '戌'){
          yearList.add("华盖");
        }
        if(sizhuModel.monthZ == '戌'){
          monthList.add("华盖");
        }
        if(sizhuModel.hourZ == '戌'){
          hourList.add("华盖");
        }
        break;
      case '亥':
      case "卯":
      case "未":
        if(sizhuModel.yearZ == '未'){
          yearList.add("华盖");
        }
        if(sizhuModel.monthZ == '未'){
          monthList.add("华盖");
        }
        if(sizhuModel.hourZ == '未'){
          hourList.add("华盖");
        }
        break;
      case '申':
      case "子":
      case "辰":
        if(sizhuModel.yearZ == '辰'){
          yearList.add("华盖");
        }
        if(sizhuModel.monthZ == '辰'){
          monthList.add("华盖");
        }
        if(sizhuModel.hourZ == '辰'){
          hourList.add("华盖");
        }
        break;
    }

    switch(sizhuModel.dayZ){
      case '巳':
      case "酉":
      case "丑":
        if(sizhuModel.yearZ == '酉'){
          yearList.add("将星");
        }
        if(sizhuModel.monthZ == '酉'){
          monthList.add("将星");
        }
        if(sizhuModel.hourZ == '酉'){
          hourList.add("将星");
        }
        break;
      case '寅':
      case "午":
      case "戌":
        if(sizhuModel.yearZ == '午'){
          yearList.add("将星");
        }
        if(sizhuModel.monthZ == '午'){
          monthList.add("将星");
        }
        if(sizhuModel.hourZ == '午'){
          hourList.add("将星");
        }
        break;
      case '亥':
      case "卯":
      case "未":
        if(sizhuModel.yearZ == '卯'){
          yearList.add("将星");
        }
        if(sizhuModel.monthZ == '卯'){
          monthList.add("将星");
        }
        if(sizhuModel.hourZ == '卯'){
          hourList.add("将星");
        }
        break;
      case '申':
      case "子":
      case "辰":
        if(sizhuModel.yearZ == '子'){
          yearList.add("将星");
        }
        if(sizhuModel.monthZ == '子'){
          monthList.add("将星");
        }
        if(sizhuModel.hourZ == '子'){
          hourList.add("将星");
        }
        break;
    }

    //金舆
    switch(sizhuModel.dayG){
      case '甲':
        if(sizhuModel.yearZ == '辰'){
          yearList.add('金舆');
        }
        if(sizhuModel.monthZ == '辰'){
          monthList.add('金舆');
        }
        if(sizhuModel.dayZ == '辰'){
          dayList.add('金舆');
        }
        if(sizhuModel.hourZ == '辰'){
          hourList.add('金舆');
        }
        break;
      case '乙':
        if(sizhuModel.yearZ == '巳'){
          yearList.add('金舆');
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add('金舆');
        }
        if(sizhuModel.dayZ == '巳'){
          dayList.add('金舆');
        }
        if(sizhuModel.hourZ == '巳'){
          hourList.add('金舆');
        }
        break;
      case '丙':
      case '戊':
        if(sizhuModel.yearZ == '未'){
          yearList.add('金舆');
        }
        if(sizhuModel.monthZ == '未'){
          monthList.add('金舆');
        }
        if(sizhuModel.dayZ == '未'){
          dayList.add('金舆');
        }
        if(sizhuModel.hourZ == '未'){
          hourList.add('金舆');
        }
        break;
      case '丁':
      case '己':
        if(sizhuModel.yearZ == '申'){
          yearList.add('金舆');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('金舆');
        }
        if(sizhuModel.dayZ == '申'){
          dayList.add('金舆');
        }
        if(sizhuModel.hourZ == '申'){
          hourList.add('金舆');
        }
        break;
      case '庚':
        if(sizhuModel.yearZ == '戌'){
          yearList.add('金舆');
        }
        if(sizhuModel.monthZ == '戌'){
          monthList.add('金舆');
        }
        if(sizhuModel.dayZ == '戌'){
          dayList.add('金舆');
        }
        if(sizhuModel.hourZ == '戌'){
          hourList.add('金舆');
        }
        break;
      case '辛':
      case '亥':
      case '壬':
      case '丑':
        if(sizhuModel.yearZ == '寅'){
          yearList.add('金舆');
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add('金舆');
        }
        if(sizhuModel.dayZ == '寅'){
          dayList.add('金舆');
        }
        if(sizhuModel.hourZ == '寅'){
          hourList.add('金舆');
        }
    }
    //天医
   if(sizhuModel.yearZ == zhis[(zhis.indexOf(sizhuModel.monthZ)-1)%12]){
     yearList.add('天医');
   }
    if(sizhuModel.monthZ == zhis[(zhis.indexOf(sizhuModel.monthZ)-1)%12]){
      monthList.add('天医');
    }
    if(sizhuModel.dayZ == zhis[(zhis.indexOf(sizhuModel.monthZ)-1)%12]){
      dayList.add('天医');
    }
    if(sizhuModel.hourZ == zhis[(zhis.indexOf(sizhuModel.monthZ)-1)%12]){
      hourList.add('天医');
    }
    if(['戊寅','甲午','戊申','甲子'].contains(sizhuModel.dayG+sizhuModel.dayZ)){
      dayList.add('天赦日');
    }
    //羊刃
    switch(sizhuModel.dayG){
      case '甲':
        if(sizhuModel.yearZ == '卯'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '卯'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '卯'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '卯'){
          hourList.add('羊刃');
        }
        break;
      case '乙':
        if(sizhuModel.yearZ == '寅'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '寅'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '寅'){
          hourList.add('羊刃');
        }
        break;
      case '丙':
      case '戊':
        if(sizhuModel.yearZ == '午'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '午'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '午'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '午'){
          hourList.add('羊刃');
        }
        break;
      case '丁':
      case '己':
        if(sizhuModel.yearZ == '巳'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '巳'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '巳'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '巳'){
          hourList.add('羊刃');
        }
        break;
      case '庚':
        if(sizhuModel.yearZ == '酉'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '酉'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '酉'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '酉'){
          hourList.add('羊刃');
        }
        break;
      case '辛':
        if(sizhuModel.yearZ == '申'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '申'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '申'){
          hourList.add('羊刃');
        }
        break;
      case '壬':
        if(sizhuModel.yearZ == '子'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '子'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '子'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '子'){
          hourList.add('羊刃');
        }
        break;
      case '癸':
        if(sizhuModel.yearZ == '亥'){
          yearList.add('羊刃');
        }
        if(sizhuModel.monthZ == '亥'){
          monthList.add('羊刃');
        }
        if(sizhuModel.dayZ == '亥'){
          dayList.add('羊刃');
        }
        if(sizhuModel.hourZ == '亥'){
          hourList.add('羊刃');
        }
        break;
    }
    //劫煞
    switch(sizhuModel.dayZ){
      case '申':
      case '子':
      case '辰':
      if(sizhuModel.yearZ == '酉'){
        yearList.add('劫煞');
      }
      if(sizhuModel.monthZ == '巳'){
        monthList.add('劫煞');
      }
      if(sizhuModel.dayZ == '巳'){
        dayList.add('劫煞');
      }
      if(sizhuModel.hourZ == '巳'){
        hourList.add('劫煞');
      }
      break;
      case '巳':
      case '酉':
      case '丑':
        if(sizhuModel.yearZ == '寅'){
          yearList.add('劫煞');
        }
        if(sizhuModel.monthZ == '寅'){
          monthList.add('劫煞');
        }
        if(sizhuModel.dayZ == '寅'){
          dayList.add('劫煞');
        }
        if(sizhuModel.hourZ == '寅'){
          hourList.add('劫煞');
        }
        break;
      case '亥':
      case '卯':
      case '未':
        if(sizhuModel.yearZ == '申'){
          yearList.add('劫煞');
        }
        if(sizhuModel.monthZ == '申'){
          monthList.add('劫煞');
        }
        if(sizhuModel.dayZ == '申'){
          dayList.add('劫煞');
        }
        if(sizhuModel.hourZ == '申'){
          hourList.add('劫煞');
        }
        break;
      case '寅':
      case '午':
      case '戌':
        if(sizhuModel.yearZ == '亥'){
          yearList.add('劫煞');
        }
        if(sizhuModel.monthZ == '亥'){
          monthList.add('劫煞');
        }
        if(sizhuModel.dayZ == '亥'){
          dayList.add('劫煞');
        }
        if(sizhuModel.hourZ == '亥'){
          hourList.add('劫煞');
        }
        break;
    }

    //桃花
    switch(sizhuModel.dayZ){
      case '申':
      case '子':
      case '辰':
        if(sizhuModel.yearZ == '酉'){
          yearList.add('桃花');
        }
        if(sizhuModel.monthZ == '酉'){
          monthList.add('桃花');
        }
        if(sizhuModel.dayZ == '酉'){
          dayList.add('桃花');
        }
        if(sizhuModel.hourZ == '酉'){
          hourList.add('桃花');
        }
        break;
      case '巳':
      case '酉':
      case '丑':
        if(sizhuModel.yearZ == '午'){
          yearList.add('桃花');
        }
        if(sizhuModel.monthZ == '午'){
          monthList.add('桃花');
        }
        if(sizhuModel.dayZ == '午'){
          dayList.add('桃花');
        }
        if(sizhuModel.hourZ == '午'){
          hourList.add('桃花');
        }
        break;
      case '亥':
      case '卯':
      case '未':
        if(sizhuModel.yearZ == '子'){
          yearList.add('桃花');
        }
        if(sizhuModel.monthZ == '子'){
          monthList.add('桃花');
        }
        if(sizhuModel.dayZ == '子'){
          dayList.add('桃花');
        }
        if(sizhuModel.hourZ == '子'){
          hourList.add('桃花');
        }
        break;
      case '寅':
      case '午':
      case '戌':
        if(sizhuModel.yearZ == '卯'){
          yearList.add('桃花');
        }
        if(sizhuModel.monthZ == '卯'){
          monthList.add('桃花');
        }
        if(sizhuModel.dayZ == '卯'){
          dayList.add('桃花');
        }
        if(sizhuModel.hourZ == '卯'){
          hourList.add('桃花');
        }
        break;
    }

    list.add(yearList);
    list.add(monthList);
    list.add(dayList);
    list.add(hourList);
    return list;
  }


  ///节气计算
  JieqiModel getJieqi(int century,int year) {
    JieqiModel jieqiModel = JieqiModel();
    var jan =<String> [];
    for (int i = 1; i < 13; i++) {
      switch (i) {
        case 2:
          for (int index = 1; index < 29; index++) {
            jan.add("$i月$index");
          }
          break;
        case 12:
        case 10:
        case 8:
        case 7:
        case 5:
        case 3:
        case 1:
          for (int index = 1; index < 32; index++) {
            jan.add("$i月$index");
          }
          break;
        default:
          for (int index = 1; index < 31; index++) {
            jan.add("$i月$index");
          }
      }

    }
    //计算出二十节气日期
    var c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
        c17, c18, c19, c20, c21, c22, c23, c24;
    switch (century) {
      //二十世纪
      case 19:
        c1 = 4.6295;
        c2 = 19.4599;
        c3 = 6.3826;
        c4 = 21.4155;
        c5 = 5.59;
        c6 = 20.888;
        c7 = 6.318;
        c8 = 21.86;
        c9 = 6.5;
        c10 = 22.2;
        c11 = 7.928;
        c12 = 23.65;
        c13 = 8.35;
        c14 = 23.95;
        c15 = 8.44;
        c16 = 23.822;
        c17 = 9.098;
        c18 = 24.218;
        c19 = 8.218;
        c20 = 23.08;
        c21 = 7.9;
        c22 = 22.6;
        c23 = 6.11;
        c24 = 20.84;

        break;

    //二十一世纪
      case 20:
        c1 = 3.87;
        c2 = 18.73;
        c3 = 5.63;
        c4 = 20.646;
        c5 = 4.81;
        c6 = 20.1;
        c7 = 5.52;
        c8 = 21.04;
        c9 = 5.678;
        c10 = 21.37;
        c11 = 7.108;
        c12 = 22.83;
        c13 = 7.5;
        c14 = 23.13;
        c15 = 7.646;
        c16 = 23.042;
        c17 = 8.318;
        c18 = 23.438;
        c19 = 7.438;
        c20 = 22.36;
        c21 = 7.18;
        c22 = 21.94;
        c23 = 5.4055;
        c24 = 20.12;
        break;
      default:
    }
    var lichun = ((year * 0.2422 + c1) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(lichun);
    var yushui = ((year * 0.2422 + c2) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(yushui);
    var jingzhe = ((year * 0.2422 + c3) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(jingzhe);
    var chunfen = ((year * 0.2422 + c4) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(chunfen);
    var qingming = ((year * 0.2422 + c5) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(qingming);
    var guyu = ((year * 0.2422 + c6) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(guyu);
    var lixia = ((year * 0.2422 + c7) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(lixia);
    var xiaoman = ((year * 0.2422 + c8) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(xiaoman);
    var mangzhong = ((year * 0.2422 + c9) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(mangzhong);
    var xiazhi = ((year * 0.2422 + c10) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(xiazhi);
    var xiaoshu = ((year * 0.2422 + c11) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(xiaoshu);
    var dashu = ((year * 0.2422 + c12) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(dashu);
    var liqiu = ((year * 0.2422 + c13) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(liqiu);
    var chushu = ((year * 0.2422 + c14) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(chushu);
    var bailu = ((year * 0.2422 + c15) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(bailu);
    var qiufen = ((year * 0.2422 + c16) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(qiufen);
    var hanlu = ((year * 0.2422 + c17) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(hanlu);
    var shuangjiang = ((year * 0.2422 + c18) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(shuangjiang);
    var lidong = ((year * 0.2422 + c19) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(lidong);
    var xiaoxue = ((year * 0.2422 + c20) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(xiaoxue);
    var daxue = ((year * 0.2422 + c21) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(daxue);
    var dongzhi = ((year * 0.2422 + c22) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(dongzhi);
    var xiaohan = (((year) * 0.2422 + c23) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(xiaohan);
    var dahan = (((year) * 0.2422 + c24) - (year - 1) / 4) ~/ 1;
    jieqiModel.limit.add(dahan);
    print(
        "立春：2月$lichun日  雨水：2月$yushui日  惊蛰：3月$jingzhe日  春分：3月$chunfen日  清明：4月$qingming日  谷雨：4月$guyu日");
    print(
        "立夏：5月$lixia日  小满：5月$xiaoman日  芒种：6月$mangzhong日  夏至：6月$xiazhi日  小暑：7月$xiaoshu日  大暑：7月$dashu日");
    print(
        "立秋：8月$liqiu日  处暑：8月$chushu日  白露：9月$bailu日  秋分：9月$qiufen日  寒露：10月$hanlu日  霜降：10月$shuangjiang日");
    print(
        "立冬：11月$lidong日  小雪：11月$xiaoxue日  大雪：12月$daxue日  冬至：12月$dongzhi日  小寒：1月$xiaohan日  大寒：1月$dahan日");

    var yin = jan.getRange(30 + lichun, 58 + jingzhe).toList();
    jieqiModel.range.add(yin);
    var mao = jan.getRange(58 + jingzhe, 89 + qingming).toList();
    jieqiModel.range.add(mao);
    var chen = jan.getRange(89 + qingming, 119 + lixia).toList();
    jieqiModel.range.add(chen);
    var si = jan.getRange(119 + lixia, 150 + mangzhong).toList();
    jieqiModel.range.add(si);
    var wu = jan.getRange(150 + mangzhong, 180 + xiaoshu).toList();
    jieqiModel.range.add(wu);
    var wei = jan.getRange(180 + xiaoshu, 211 + liqiu).toList();
    jieqiModel.range.add(wei);
    var shen = jan.getRange(211 + liqiu, 242 + bailu).toList();
    jieqiModel.range.add(shen);
    var you = jan.getRange(242 + bailu, 272 + hanlu).toList();
    jieqiModel.range.add(you);
    var xu = jan.getRange(272 + hanlu, 303 + lidong).toList();
    jieqiModel.range.add(xu);
    var hai = jan.getRange(303 + lidong, 333 + daxue).toList();
    jieqiModel.range.add(hai);
    var zi = jan.getRange(333 + daxue, jan.length).toList();
    jieqiModel.range.add(zi);
    zi.addAll(jan.getRange(0, xiaohan - 1));
    var chou = jan.getRange(xiaohan - 1, 30 + lichun).toList();
    jieqiModel.range.add(chou);
    return jieqiModel ;
  }
}